package com.chen.flinkdemo.source;

import com.chen.flinkdemo.Access;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * @author: cy
 * @date: 2024/8/29 23:12
 * @description:
 */


public class SourceFunctionApp {

    public static void main(String[] args) {

        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        // DataStreamSource<Access> source = env.addSource(new AccessSource()).setParallelism(2);
        DataStreamSource<Access> source = env.addSource(new AccessSource());
        System.out.println("source并行：" + source.getParallelism());
        source.print();
    }
}
